Status badge layout fix

jamesperet 11 years ago
parent
commit
ed6514894a

+ 2 - 1
app/assets/stylesheets/missions.css.less

@@ -7,10 +7,11 @@
7 7
 }
8 8
 
9 9
 .mission_thumb h3, .mission_thumb h5  {
10
-	padding-top: 0px;
10
+	padding-top: 5px;
11 11
 	padding-left: 5px;
12 12
 	padding-right: 5px;
13 13
 	margin-top: -10px;
14
+	line-height: 25px;
14 15
 }
15 16
 
16 17
 .mission_thumb small {

+ 2 - 6
app/controllers/missions_controller.rb

@@ -31,10 +31,6 @@ class MissionsController < ApplicationController
31 31
   # GET /missions/new
32 32
   def new
33 33
     @mission = Mission.new
34
-    @mission.owner = current_user
35
-    @mission.save
36
-    a = @mission.mission_agents.new
37
-    a.save
38 34
     @mission.mission_agents.build
39 35
     @mission.mission_agents.each do |agent|
40 36
       agent.mission_agent_steps.build
@@ -48,12 +44,12 @@ class MissionsController < ApplicationController
48 44
   # POST /missions
49 45
   # POST /missions.json
50 46
   def create
51
-    @mission = Mission.find(mission_params)
47
+    @mission = Mission.new(mission_params)
52 48
     @mission.status = 'Initializing'
53 49
     @mission.owner = current_user
54 50
     respond_to do |format|
55 51
       if @mission.save
56
-        format.html { redirect_to @mission, notice: 'Mission was successfully created.' }
52
+        format.html { redirect_to mission_control_path(@mission), notice: 'Mission was successfully created.' }
57 53
         format.json { render action: 'show', status: :created, location: @mission }
58 54
       else
59 55
         format.html { render action: 'new' }

+ 1 - 1
app/views/missions/_mission_status.html.erb

@@ -13,7 +13,7 @@
13 13
 	  </h4>
14 14
 	</span>
15 15
 <% else %>
16
-	<span class="label <%= @status_label %> pull-right" style="margin-top: 10px;">
16
+	<span class="label <%= @status_label %> pull-right" style="margin-top: 5px;">
17 17
 		 <%= mission.status %>
18 18
 	</span>
19 19
 <% end%>

+ 3 - 3
app/views/missions/index.html.erb

@@ -1,5 +1,5 @@
1 1
 <div class="page-header">
2
-  <h1>Missions Dashboard</h1>
2
+  <h1>Missions Dashboard <%= link_to 'New Mission', new_mission_path, :class => 'btn btn-small btn-default' %></h1>
3 3
 </div>
4 4
 <ul class="thumbnails">
5 5
 	<% if @mission_invites.length > 0 %>
@@ -27,7 +27,7 @@
27 27
 				<li class="span4">
28 28
 				    <div class="thumbnail mission_thumb" >
29 29
 					      <small>Mission Details</small>
30
-					      <h3><%= invite.mission_agent.mission.title %> <%= render 'mission_status', :mission => invite.mission_agent.mission, :big => false %></h3>
30
+					      <h3><%= truncate(invite.mission_agent.mission.title, :length => 23) %> <%= render 'mission_status', :mission => invite.mission_agent.mission, :big => false %></h3>
31 31
 						 <h5 >Steps Completed: <%= render 'mission_agent_steps_count', :invite => invite %></h5>
32 32
 					      <p style= "padding: 5px; height: 50px;"><%= invite.mission_agent.mission.description %></p>
33 33
 						 <%= link_to 'View Mission Details', mission_path(invite.mission_agent.mission), :class => "btn btn-small btn-block btn-default" %>
@@ -42,7 +42,7 @@
42 42
 				<li class="span4">
43 43
 				    <div class="thumbnail mission_thumb">
44 44
 					      <small>Mission Control</small>
45
-					      <h3><%= mission.title %> <%= render 'mission_alert_badge', :mission => mission %> <%= render 'mission_status', :mission => mission, :big => false %></h3>
45
+					      <h3><%= truncate(mission.title, :length => 21) %> <%= render 'mission_alert_badge', :mission => mission %> <%= render 'mission_status', :mission => mission, :big => false %></h3>
46 46
 						 <h5 >Agents: <%= mission.mission_agents.length %></h5>
47 47
 					      <p style= "padding: 5px; height: 50px;"><%= mission.description %></p>
48 48
 						 <% @owner_agent = false %>